﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using Newtonsoft.Json;
using Gw2Api;
using System.Diagnostics;

namespace Gw2ApiTestApp
{

    public class WvWObjective
    {
        public string id;
        public string name;
    }

    class Program
    {
        static void Main(string[] args)
        {
            WvWApi api = Gw2ApiFactory.WvWApi;
            //api.load();
            api.Update += HandleUpdate;
            api.AddMatchupToRefreshList(WvWRegion.NorthAmerica, 1);
            api.AddMatchupToRefreshList(WvWRegion.NorthAmerica, 2);
            api.AddMatchupToRefreshList(WvWRegion.NorthAmerica, 3);
            api.AddMatchupToRefreshList(WvWRegion.NorthAmerica, 4);
            api.AddMatchupToRefreshList(WvWRegion.NorthAmerica, 8);
            api.SetAutoUpdate(true);
            Console.ReadLine();
        }

        static void HandleUpdate(List<BaseDiff> diffs)
        {
            foreach (var d in diffs)
            {
                WvWObjectiveDiff diff = (WvWObjectiveDiff)d;
                Debug.WriteLine(d);
            }
        }
    }
}
